package cn.qyd.io;

import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import com.sun.xml.internal.messaging.saaj.util.CharReader;
import com.sun.xml.internal.messaging.saaj.util.CharWriter;
import jdk.internal.util.xml.impl.Input;
import org.checkerframework.checker.units.qual.C;

import java.io.*;

/**
 * @author 邱运铎
 * @date 2024-03-21 14:56
 */
public class IOAllDemo {
    public static void main(String[] args) throws IOException {
        //字节流输入
        ByteInputStream byteInputStream = new ByteInputStream();
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream("Hello World".getBytes());
        File file = new File("/s");
        FileInputStream fileInputStream = new FileInputStream(file);
        BufferedInputStream bufferedInputStream = new BufferedInputStream(byteInputStream);
        ObjectInputStream objectInputStream = new ObjectInputStream(byteInputStream);
        PipedInputStream pipedInputStream = new PipedInputStream();
        DataInputStream dataInputStream = new DataInputStream(System.in);
        //字节流输出
        ByteOutputStream byteOutputStream = new ByteOutputStream();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        FileOutputStream fileOutputStream = new FileOutputStream(file);
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(byteOutputStream);
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteOutputStream);
        PipedOutputStream pipedOutputStream = new PipedOutputStream();
        DataOutputStream dataOutputStream = new DataOutputStream(System.out);
        dataOutputStream.writeUTF("Hello");
        PrintStream printStream = new PrintStream(System.out);

        //字符流输入
        char[] chars = new char[4];
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        CharReader charReader = new CharReader(chars,chars.length);
        CharArrayReader charArrayReader = new CharArrayReader(chars);
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        PipedReader pipedReader = new PipedReader();
        FileReader fileReader = new FileReader(file);
        //字符流输出
        PrintWriter printWriter = new PrintWriter(System.out);
        CharWriter charWriter = new CharWriter();
        CharArrayWriter charArrayWriter = new CharArrayWriter();
        BufferedWriter bufferedWriter = new BufferedWriter(printWriter);
        PipedWriter pipedWriter = new PipedWriter();
        FileWriter fileWriter = new FileWriter(file);

    }
}
